package reflect;

/**
 * 使用当前类测试反射机制
 */
@AutoRunClass
public class Person {
    private String name = "张三";
    private int age = 18;

    public Person(){}

    public Person(String name){
        this.name = name;
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void sayHello(){
        System.out.println("Person:大家好!");
    }
    @AutoRun(10)
    public void sayHi(){
        System.out.println("Person:嗨!!");
    }
    public void playGame(){
        System.out.println("Person:一起打游戏呀!");
    }

    public void say(String name,String info){
        System.out.println("我是"+name+","+info);
    }

    public void say(String name,int sum){
        for(int i=0;i<sum;i++){
            System.out.println("我是"+name);
        }
    }

    private void hehe(){
        System.out.println("我是Person的私有方法!!");
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
